home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PAS_0793
/
ARCHIVES.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-07-21
|
4KB
|
108 lines
─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 301 of 379
From : MIKE COPELAND 1:114/151.0 19 Jul 93 14:27
To : ALL
Subj : ARCHIVES TPU 1/4
────────────────────────────────────────────────────────────────────────────────
In this and the following messages are the basics. I have cut out a
lot of material from my program (I don't want to give away _all_ my
secrets <g>), and I believe you'll be able to work from this much.
const
BSize = 4096; { I/O Buffer Size }
HMax = 512; { Header Maximum Size }
type MEDBUF = array[1..BSize] of char;
var
C : LongInt; { Buffer Offset }
FSize : LongInt; { File Size }
CH, CH1 : char;
BIN,BOUT,
BWORK : ^MEDBUF;
F : File;
SNAME : String;
DATE : string[8]; { formatted date as YY/MM/DD }
TIME : string[5]; { " time as HH:MM }
X1,X2,X3,X4,
X5,X6,X7,X8,
X9,X10,X11,
X12 : string;
DISKNAME : string[15];
PRIORAN : STR12; { Prior Archive Name }
DirInfo : SearchRec; { File name search type }
SR : SearchRec;
DT : DateTime;
PATH : PathStr;
DIR : DirStr;
FNAME : NameStr;
EXT : ExtStr;
Regs : Registers;
Temp : String[1];
BUFF : array[1..BSize] of Byte;
(**************************** ARJ Files Processing ***************************)
Type ARJHead = record
FHeadSize : Byte;
ArcVer1,
ArcVer2 : Byte;
HostOS,
ARJFlags,
Method : Byte; { MethodType = (Stored, LZMost, LZFast); }
R1,R2 : Byte;
DOS_DT : LongInt;
CompSize,
UCompSize,
CRC : LongInt;
ENP, FM,
HostData : Word;
end;
Var ARJ1 : ARJHead;
ARJId : Word; { 60000, if ARJ file }
HSize : Word; { Header Size }
procedure GET_ARJ_ENTRY;
begin
FillChar(ARJ1,SizeOf(ARJHead),#0); FillChar(BUFF,BSize,#0);
Seek (F,C-1); BlockRead(F,BUFF,BSIZE,RES); { read header into buffer }
Move (BUFF[1],ARJId,2); Move (BUFF[3],HSize,2);
if HSize > 0 then
with ARJ1 do
begin
Move (BUFF[5],ARJ1,SizeOf(ARJHead));
I := FHeadSize+5; SNAME := B40;
while BUFF[I] > 0 do Inc (I);
I := I-FHeadSize-5;
Move (BUFF[FHeadSize+5],SNAME[1],I); SNAME[0] := Chr(I);
FSize := CompSize; Inc (C,HSIZE);
end;
end; { GET_ARJ_ENTRY }
procedure DO_ARJ (FN : string);
begin
ADD_ANAME; Assign (F,FN); Reset (F,1); C := 1;
GET_ARJ_ENTRY; { Process file
Header }
repeat
Inc(C,FSize+10);
GET_ARJ_ENTRY;
if HSize > 0 then
begin
Inc (WPX); New(SW[WPX]); { store filename info in dynamic array }
with SW[WPX]^ do
begin
FSplit (SNAME,DIR,FNAME,EXT); F := FNAME; E := Copy(EXT+' ',1,4)
SIZE := ARJ1.UCompSize;
RTYPE := 4; D_T := ARJ1.DOS_DT; ANUM := ADX; VNUM := VDX;
ADD_CNAME;
end;
Inc (CCT); SSL; Inc (ARCS[ADX]^.COUNT)
end;
until HSize <= 0;
Close (F);
end; { DO_ARJ }
... The problem with political jokes is they get elected.
--- Via Silver Xpress V3.02B12
--- GOMail v1.1 [DEMO] 08-14-93
* Origin: The Private Reserve - Phoenix, AZ (602) 997-9323 (1:114/151)